#include "form.h"
#include "ui_form.h"
#include "mainscene.h"
#include "ship.h"

Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
     setWindowTitle("请选择你的舰船");
    QPixmap pix7("D:\\qt\\untitled12\\res\\xiaoyuehan.jpg");
    ui->label_7->setPixmap(pix7);
    QPixmap pix8("D:\\qt\\untitled12\\res\\duominghai.jpg");
    ui->label_8->setPixmap(pix8);
    QPixmap pix2("D:\\qt\\untitled12\\res\\hangmu1cemian.png");
    ui->label_2->setPixmap(pix2);
    QPixmap pix3("D:\\qt\\untitled12\\res\\hangmu2cemian.png");
    ui->label_3->setPixmap(pix3);
    QPixmap pix1("D:\\qt\\untitled12\\res\\h2c.png");
    ui->label->setPixmap(pix1);
    QPixmap pix4("D:\\qt\\untitled12\\res\\xiaochan1cemian.png");

    QPixmap pix5("D:\\qt\\untitled12\\res\\x1c.png");
    ui->label_5->setPixmap(pix5);
    QPixmap pix6("D:\\qt\\untitled12\\res\\x2c.png");
    ui->label_6->setPixmap(pix6);
    ui->label_4->setPixmap(pix6);
}

Form::~Form()
{
    delete ui;
}

//void Form::sendP(int value)
//{
  //  emit sendP(value); // 发射sendP信号，并将获取的数值作为参数传递
//}

void Form::on_hangmuButton_1_clicked()
{
    MainScene *w=new MainScene;
   // connect(this, &Form::sendP, w, &MainScene::setP);
    //emit sendP(1);
    w->myship=ship(1);
    w->p=1;
    w->show();
        //this->close();

}


void Form::on_hangmuButton_2_clicked()
{
        MainScene *w=new MainScene;
        //int *c=new int(2);
        //connect(this, &Form::sendP, w, &MainScene::setP);
        //emit sendP(2);
         w->myship=ship(2);
        w->p=2;
        w->show();
        //this->close();
}


void Form::on_hangmuButton3_clicked()
{

        MainScene *w=new MainScene;
        //int *c=new int(3);
        // w->myship=ship(3);
        //connect(this, &Form::sendP, w, &MainScene::setP);
        //emit sendP(3);
        //int *p=new int(1);
         w->myship=ship(3);
        w->p=3;
         w->a=7;
        w->show();
        //this->close();
}


void Form::on_xiaochuanButton_1_clicked()
{

        MainScene *w=new MainScene;
        //int *c=new int(4);
        //connect(this, &Form::sendP, w, &MainScene::setP);
       // emit sendP(4);
         w->myship=ship(4);
        w->p=4;
        w->show();
        //this->close();
}


void Form::on_xiaochuanButton_2_clicked()
{

        MainScene *w=new MainScene;
        //int *c=new int(5);
       // connect(this, &Form::sendP, w, &MainScene::setP);
       // emit sendP(5);
         w->myship=ship(5);
        w->p=5;
        w->show();
        //this->close();
}


void Form::on_xiaochuanButton_3_clicked()
{

        MainScene *w=new MainScene;
        //int *c=new int(6);
        //connect(this, &Form::sendP, w, &MainScene::setP);
       // emit sendP(6);
         w->myship=ship(6);
        w->p=6;
        w->show();
        //this->close();
}

